package com.qwz.example;
/**
* @Description: 价格管理，主要完成计算向客户所报价的功能
* @Package com.qwz.example.Price
* @author Qiuwuzhi
* @date 2019/12/25 13:39
* @version V1.0
*/
public class Price {
    /**
     * 持有一个具体的策略对象
     */
    private Strategy strategy;


    public Price(Strategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 报价，计算对客户的报价
     * @param goodsPrice
     * @return
     */
    double quote(double goodsPrice){
       return strategy.calcPrice(goodsPrice);
    }
}
